<include file="public@header"/>
</head>
<body>
<div class="wrap">

    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('leader/staff_add')}"
          enctype="multipart/form-data">


        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>姓名
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="name">
            </div>
        </div>

        <div class="form-group">

            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>联系方式
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="number" class="form-control" name="mobile">
            </div>
        </div>

        <div class="form-group">

            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>入职时间
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="date" class="form-control" name="incTime">
            </div>
        </div>


        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                离职时间
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="date" class="form-control" name="outTime">
            </div>
        </div>

        <input type="hidden" name="P_id" value="{$id}">

        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>身份证正/反面
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="file" id="idCardUpload" name="image[]" class="form-control" multiple accept="image/*" />
                <div id="idCardPreviewContainer" class="image-preview-container" style="margin-top: 10px; display: flex; flex-wrap: wrap;"></div>
            </div>
        </div>


        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
            </div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/image-uploader.js"></script>
<script>
    // 页面加载完成后初始化所有功能
    document.addEventListener('DOMContentLoaded', function() {
        // 初始化身份证图片上传组件
        const idCardUploader = new ImageUploader({
            inputId: 'idCardUpload',
            previewContainerId: 'idCardPreviewContainer',
            fieldName: 'image',
            useDataTransfer: true
        });
    });
</script>
</body>
</html>
